package com.sql.azarias.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ImageView;

import com.sql.azarias.R;
import com.sql.azarias.activity.BaseActivity;
import com.sql.azarias.views.ScrollZoomListView;

/**
 * Created by Administrator on 2017/2/24.
 */

public class SpaceAtivity extends BaseActivity {
    private ScrollZoomListView zoom_listView;


    @Override
    protected void onCreate( Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_space);

        zoom_listView = (ScrollZoomListView)findViewById(R.id.zoom_listView);
        View headerView = View.inflate(this, R.layout.itme_space_header, null);
        ImageView ivBackground = (ImageView) headerView.findViewById(R.id.ivBackground);
        zoom_listView.addHeaderView(headerView);

        zoom_listView.setZoomImageView(ivBackground);
        ArrayAdapter<String> adapter = new ArrayAdapter<>(this,
                android.R.layout.simple_list_item_1,new String[] {
                "--------------------",
                "--------------------",
                "--------------------",
                "--------------------",
                "--------------------",
                "--------------------","--------------------","--------------------",


                "...." });
        zoom_listView.setZoomImageView(ivBackground);
        zoom_listView.setAdapter(adapter);
    }
    //在view加载完成时设定缩放级别
    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {
        super.onWindowFocusChanged(hasWindowFocus);
        if (hasWindowFocus) {
            zoom_listView.setViewsBounds();
        }

    }

}
